home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 138
/
Volume 138 Aug 19 2011 - Damaged.iso
/
Games
/
shadez.swf
/
scripts
/
Local
/
Game
/
Thing
/
CShotTankShell.as
< prev
next >
Wrap
Text File
|
2011-08-19
|
2KB
|
80 lines
package Local.Game.Thing
{
import Local.Game.World.CAngle;
import Local.Game.World.CPosition;
import flash.geom.Matrix;
public class CShotTankShell extends CShot
{
public function CShotTankShell(param1:CPosition, param2:CAngle)
{
super(param1);
Process = Process_Normal;
mAngle = param2;
mMaxSpeed = mSpeed = 50;
mDelta = mAngle.GetDelta(mSpeed);
mDestination = new CPosition();
mShowOnMap = true;
AddAnimation("stand",TankShell,"AddSprite_Black");
}
public function Process_Die() : *
{
if(true)
{
DispatchDispose();
}
}
override public function Draw() : void
{
var _loc1_:Matrix = null;
if(true)
{
super.Draw();
DrawTrail(3,100);
}
_loc1_ = GetOrientationMatrix();
DrawSprite(_loc1_);
}
public function Process_Normal() : void
{
var _loc1_:CPosition = null;
var _loc2_:Array = null;
var _loc3_:CThingMain = null;
if(true)
{
mDelta = mAngle.GetDelta(mSpeed);
if(true)
{
mDestination.x = mPosition.x + mDelta.x;
}
mDestination.y = mPosition.y + mDelta.y;
}
_loc1_ = mLandscape.CollideLine(mPosition.x,mPosition.y,mDestination.x,mDestination.y);
if(_loc1_ != null)
{
mDestination.Copy(_loc1_);
Process = Process_Die;
}
_loc2_ = GetThings_Line(mPosition,mDestination,1);
if(_loc2_.length)
{
_loc3_ = _loc2_[0];
mDestination.Copy(_loc3_.mCollide.CollideLine(mPosition,mDestination));
AddThing(new CEffectExplosionMedium(mPosition));
Process = Process_Die;
}
mPosition.Copy(mDestination);
MapMoveTrail();
if(!mMap.InMap(mPosition.x,mPosition.y))
{
Process = Process_Die;
}
}
}
}